import multiprocessing
import time

num = [1,2,3]


def test():
    global num
    print(num)
    num.append(4)
    print(num)


if __name__ == '__main__':
    p = multiprocessing.Process(target=test)
    p.start()
    p.join()
    print(num)

    # 全局变量在多个进程中不能共享-----子进程是把全局变量完全拷贝一份
